{% extends "static/view/template.html" %}
{% block body %}
<div class="container">

	<div class="page-header">
	</div>

	<div class="page-header">
        <h1> <font color= #333333><center>rDSN Common Line Interface</center></font>
			<small><center><font color= #778899>type 'help' to start</font></center></small>
		</h1>
	</div>

</div>

<link href="http://terminal.jcubic.pl/css/jquery.terminal.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/javascript" src="http://terminal.jcubic.pl/js/jquery.terminal-min.js"></script>
 <div id="term_demo"></div>
    <script>
    jQuery(function($, undefined) {
    $('#term_demo').terminal(function(input_cmd, term) {
        if (input_cmd !== '') {

            var query_cmd, query_arguments;
            query_arguments = input_cmd.split(" ");
            query_cmd = query_arguments.shift();

            var client = new cliApp("http://"+localStorage['target_server']);
            result = client.call({
                    args: new command({
                    cmd: query_cmd,
                    arguments: query_arguments
                }),
                async: true,
                on_success: function (data){
                    term.echo(data);
                },
                on_fail: function (xhr, textStatus, errorThrown) {}
            });
        }
    }, {
        greetings: 'rDSN Remote Interface',
        name: 'js_demo',
        prompt: 'Cli> '});
});
    </script>
{% endblock %}
